from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
import uvicorn

app = FastAPI()

app.mount("/static", StaticFiles(directory="static"), name="static")

from apps.app01 import app1
from apps.app02 import app2
from apps.app03 import app3
from apps.app04 import app4
from apps.app05 import app5
from apps.app06 import app6
from apps.app07 import app7


@app.get("/")
def read_root():
    return {"Hello": "World"}


app.include_router(app1, prefix="/app01", tags=["01 路径参数", ])
app.include_router(app2, prefix="/app02", tags=["02 查询参数", ])
app.include_router(app3, prefix="/app03", tags=["03 请求体数据", ])
app.include_router(app4, prefix="/app04", tags=["04 Form表单请求", ])
app.include_router(app5, prefix="/app05", tags=["05 Form表单上传文件", ])
app.include_router(app6, prefix="/app06", tags=["06 Request对象", ])
app.include_router(app7, prefix="/app07", tags=["07 响应参数", ])

if __name__ == '__main__':
    uvicorn.run("main:app", host="127.0.0.1", port=8080, reload=True)
